package models

import (
	"time"
)

// user用户模型
type User struct {
	// gorm.Model
	ID          int64  `gorm:"primaryKey;column:id;not null" json:"id"`
	UserName    string `gorm:"column:username;type:varchar(255);not null" json:"username"`
	Password    string `gorm:"column:password;type:varchar(255);not null" json:"password"`
	PhoneNumber string `gorm:"column:phone_number;type:varchar(255);not null" json:"phone_number"`
	RealName    string `gorm:"column:realname;type:varchar(255);not null" json:"realname"`
	Status      string `gorm:"column:status;type:varchar(255);not null" json:"status"`
	CreatedAt   time.Time
	UpdatedAt   time.Time
	DeletedFlag bool   `gorm:"column:deleted_flag;type:tinyint(1);not null" json:"deleted_flag"`
	EnableFlag  bool   `gorm:"column:enable_flag;type:tinyint(1);not null" json:"enable_flag"`
	Remark      string `gorm:"column:remark;type:varchar(255);not null" json:"remark"`
}

// 设置表名称
func (table *User) TableName() string {
	return "user"
}
